<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // //替换里面所有的o
        // var str = "abcdeofhsjvooaskno";
        // while(str.indexOf('o') !== -1){
        //     str = str.replace('o','*')
        // }
        // console.log(str);
        // //字符转换为数组
        // var ar = 'red,pink,blue';
        // console.log(ar.split(','));
        // var arr = 'red&pink&blue';
        // console.log(str3.split('&'));

        //abaasdffggghhjjkkgfddsssss344343
        var str = 'abaasdffggghhjjkkgfddsssss344343';
        //获取字符长度
        var index = str.length;
        console.log(index);
        //取出指定字符的位置0，3，5，9   题目在186集
        var newStr = ''
        for(var i = 0; i < str.length; i++){
            if(str[i].indexOf == 3 || str[i].indexOf == 5 || str[i].indexOf == 9){
                console.log(str[i].indexOf == 3);
                newStr = str[i]
            }
        }
        console.log(newStr);
    </script>
</body>
</html>